<template>
	<view class="page_bg">
		<mp-html :content="richText"></mp-html>
	</view>
</template>

<script>
	var that; // 当前页面对象
	var vk; // vk依赖
	export default {
		data() {
			// 页面数据变量
			return {
				richText: ''
			}
		},
		// 监听 - 页面每次【加载时】执行(如：前进)
		onLoad(options = {}) {
			that = this;
			vk = that.vk;
			that.init(options)
		},
		// 函数
		methods: {
			// 页面数据初始化函数
			init(options) {
				let type = options.type - 0
				let title = type == 1 ? '隐私政策' : '用户协议'
				uni.setNavigationBarTitle({ title })
				vk.callFunction({
					url: 'client/policy/pub/get_policy',
					title: '请求中...',
					data: { type },
					success: (res) => { that.richText = res.data.content }
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page_bg {
		padding: 26rpx;
	}
</style>
